/**
 * 
 */
package com.yangtao.prototype.system.organize.web;

import com.yangtao.framework.web.BaseAction;
import com.yangtao.prototype.system.organize.service.OrganizeModel;
import com.yangtao.prototype.system.organize.service.OrganizeService;

/**
 * @author 杨涛
 * 
 */
public class OrganizeAction extends BaseAction<OrganizeModel, OrganizeService> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String init() {
		return render("OrganizeAdd");
	}

	public String load() {
		return render("OrganizeAdd");
	}

	public String save() {
		service.save(model);
		return renderJsonMessage();
	}

	public String delete() {
		service.delete(model);
		return renderJsonMessage();
	}

	public String list() {
		service.list(model);
		return render("OrganizeList");
	}

	public String loadTree() {
		service.findAll(model);
		return renderJson(model.getTree());
	}

	public void prepare() {
		service.load(model);
	}

}
